<?php
/**
 * Created by PhpStorm
 * User: whh
 * Date: 2022/7/23
 * Time: 11:53
 */

namespace app\backstage\model;


use app\common\model\Common;
use think\Model;

class RankAgent extends Model
{
    use Common;

    protected $table = 'rp_recharge_rank_agent';


    public function agent()
    {
        return $this->hasOne(ManagerUser::class, 'id', 'agent_id')->field("id,account,create_time");
    }

    public function getTodayAmountAttr($value)
    {
        return getQuotient($value, 100);
    }

    public function getTodayNewAmountAttr($value)
    {
        return getQuotient($value, 100);
    }

    public function getYesterdayAmountAttr($value)
    {
        return getQuotient($value, 100);
    }


    public function getYesterdayNewAmountAttr($value)
    {
        return getQuotient($value, 100);
    }


    public function getAmount_7Attr($value)
    {
        return getQuotient($value, 100);
    }

    public function getNewAmount_7Attr($value)
    {
        return getQuotient($value, 100);
    }

    public function getAmount_30Attr($value)
    {
        return getQuotient($value, 100);
    }

    public function getNewAmount_30Attr($value)
    {
        return getQuotient($value, 100);
    }

    public function getAmountAttr($value)
    {
        return getQuotient($value, 100);
    }
}